package com.yanqu.road.logic.bussiness.rank;

import com.yanqu.road.entity.rank.xrank.XChannelRankPart;
import com.yanqu.road.entity.rank.xrank.XSeasonStageUserRank;
import com.yanqu.road.entity.rank.xrank.XSeasonUserRank;
import com.yanqu.road.entity.rank.xrank.XUserRank;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.List;
import java.util.Set;

public class XRankBussiness {

    /**
     * 个人榜
     */

    public static List<XUserRank> getXUserRankList(String dbName, String tableName,
                                                   int activityId) {
        return DaoHelper.getXUserRankDaoImpl(dbName, tableName).getXUserRankList(activityId);
    }

    public static boolean replaceXUserRank(String dbName, String tableName,
                                           List<XUserRank> rankList, Set<Integer> dbSet) {
        return DaoHelper.getXUserRankDaoImpl(dbName, tableName).replaceXUserRank(rankList, dbSet);
    }

    /**
     * 区域榜
     */

    public static List<XChannelRankPart> getXChannelRankPartList(String dbName, String tableName,
                                                                 int activityId) {
        return DaoHelper.getXChannelRankPartDaoImpl(dbName, tableName).getXChannelRankPartList(activityId);
    }

    public static boolean replaceXChannelRankPart(String dbName, String tableName,
                                                  List<XChannelRankPart> rankList, Set<Integer> dbSet) {
        return DaoHelper.getXChannelRankPartDaoImpl(dbName, tableName).replaceXChannelRankPart(rankList, dbSet);
    }


    /**
     * 个人赛季榜
     */
    public static List<XSeasonUserRank> getXSeasonUserRankList(String dbName, String tableName,
                                                               int systemId, int seasonId, int type, String rangeKey) {
        return DaoHelper.getXSeasonUserRankDaoImpl(dbName, tableName).getXSeasonUserRankList(systemId, seasonId, type, rangeKey);
    }

    public static boolean replaceXSeasonUserRank(String dbName, String tableName,
                                                 List<XSeasonUserRank> rankList, Set<Integer> dbSet) {
        return DaoHelper.getXSeasonUserRankDaoImpl(dbName, tableName).replaceXSeasonUserRank(rankList, dbSet);
    }

    /**
     * 个人赛季阶段榜
     */
    public static List<XSeasonStageUserRank> getXSeasonStageUserRankList(String dbName, String tableName,
                                                                         int systemId, int seasonId, int type, int stage, String rangeKey) {
        return DaoHelper.getXSeasonStageUserRankDaoImpl(dbName, tableName).getXSeasonStageUserRankList(systemId, seasonId, type, stage, rangeKey);
    }

    public static boolean replaceXSeasonStageUserRank(String dbName, String tableName,
                                                 List<XSeasonStageUserRank> rankList, Set<Integer> dbSet) {
        return DaoHelper.getXSeasonStageUserRankDaoImpl(dbName, tableName).replaceXSeasonStageUserRank(rankList, dbSet);
    }

}
